package com.example.pipibee.controller;


import com.example.pipibee.service.MrService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;


@Slf4j
@RestController
@RequestMapping("/pipibee/mr")
@Validated
@Api(tags = "1.2. 病案端")
public class MrController {

    @Autowired
    MrService mrService;

    @ApiOperation("文件上传")
    @ApiOperationSupport(order = 700)
    @PostMapping("/upload")
    public void upload(MultipartFile file) {
        log.debug("开始处理【文件上传】的请求，参数：{}", file);
        mrService.upload(file);
    }

}
